package net.bwie.realtime.vehicle.dwd.function;

import net.bwie.realtime.vehicle.dwd.bean.AreaControl;
import org.apache.flink.api.common.functions.ReduceFunction;

/**
 * @author ASUS
 */
public class PageViewReportReduceFunction implements ReduceFunction<AreaControl> {
    @Override
    public AreaControl reduce(AreaControl value1, AreaControl value2) throws Exception {
        // value1：表示增加计算中间结果；value2：表示窗口中每条数据
        // 1.增量计算：表示各个指标相加
        value1.setVehicle_count(value1.getVehicle_count() + value2.getVehicle_count());
        // 2.返回结果
        return value1;
    }
}
